package cn.levi.excel.module;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 状态描述
 * @author lei
 * @since 2023/9/12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StateBo {

    /**
     * 行数
     */
    private Integer rowIndex;
    /**
     * 成功是否
     */
    private Boolean success;
    /**
     * 描述
     */
    private String reason;

    public StateBo(Boolean success)
    {
        this.success = success;
    }
    public StateBo(Boolean success,String reason )
    {
        this.success = success;
        this.reason = reason;
    }
    /**
     *
     * 成功
     * @return
     * @author lei
     */
    public static StateBo success() {
      return   new StateBo(Boolean.TRUE);
    }


    /**
     * 失败
     * @param reason
     * @return
     * @author lei
     */
    public static StateBo fail(String reason) {
        return  new StateBo(Boolean.FALSE,reason);
    }
}
